<?php

class User_Model_Ciutat extends Zend_Db_Table_Abstract
{
    protected $_name = 'ciutats';
    protected $_primary = 'nom';
    
    public function get_preu($nom){
        $select = $this->_db->select()
                    ->from($this->_name)
                    ->where('nom = "'.$nom.'"');
        $result = $select->query()->fetchAll();
        
        if(sizeof($result) == 0)    return -1;
        return $result[0]['preu'];

    }

}
?>

